<!DOCTYPE html>
<html lang="en"  style="height: 100%">
<head>
    <meta charset="UTF-8">
    <title>工作经验和薪资关系图</title>
    <script src="/static/jquery-1.12.0.min.js"></script>
    <script src="/static/echarts.min.js"></script>
</head>
<body style="height: 100%">
<div id="main" style="height: 100%"></div>
<script>
    $(function () {
        $.ajax({
            url:'/zwyx/jy',
            type:'get',
            dataType:'json',
            success:function (returnData) {
                if(returnData.status==1)
                {
                    myoption = {
                        title: {
                        text: '工作经验和薪资关系图',
                            subtext: '职位画像系统',
                            sublink: 'http://www.ibeifeng.com'
                    },
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        x: 'center',
                        data: ['总职位数','平均薪资','最大薪资','最小薪资']
                    },
                    radar: [
                        {
                            indicator: returnData.jy_list,
                            center: ['50%', '50%'],
                            startAngle: 90,
                            splitNumber: 4,
                            shape: 'circle',
                            name: {
                                formatter:'{value}',
                                textStyle: {
                                    color:'#72ACD1'
                                }
                            },
                            splitArea: {
                                areaStyle: {
                                    color: ['rgba(114, 172, 209, 0.2)',
                                    'rgba(114, 172, 209, 0.4)', 'rgba(114, 172, 209, 0.6)',
                                    'rgba(114, 172, 209, 0.8)', 'rgba(114, 172, 209, 1)'],
                                    shadowColor: 'rgba(0, 0, 0, 0.3)',
                                    shadowBlur: 10
                                }
                            },
                            axisLine: {
                                lineStyle: {
                                    color: 'rgba(255, 255, 255, 0.5)'
                                }
                            },
                            splitLine: {
                                lineStyle: {
                                    color: 'rgba(255, 255, 255, 0.5)'
                                }
                            }
                        }
                    ],
                    series: [
                        {
                            name: '雷达图',
                            type: 'radar',
                            tooltip: {
                                trigger: 'item'
                            },
                            itemStyle: {
                                emphasis: {
                                    // color: 各异,
                                    lineStyle: {
                                        width: 4
                                    }
                                }
                            },
                            data: [
                                {
                                    value: returnData.count_zw,
                                    name: '总职位数',
                                    symbol: 'rect',
                                    itemStyle: {normal: {areaStyle: {type: 'default'}}},
                                    symbolSize: 5,
                                    lineStyle: {
                                        normal: {
                                            type: 'dashed'
                                        }
                                    }
                                },
                                {
                                    value: returnData.avg_zw,
                                    name: '平均薪资',
                                    itemStyle: {normal: {areaStyle: {type: 'default'}}},
                                    areaStyle: {
                                        normal: {
                                            color: 'rgba(255, 255, 255, 0.5)'
                                        }
                                    }
                                },
                                {
                                    value: returnData.max_xz,
                                    name: '最大薪资',
                                    itemStyle: {normal: {areaStyle: {type: 'default'}}},
                                    areaStyle: {
                                        normal: {
                                            color: 'rgba(255, 255, 255, 0.5)'
                                        }
                                    }
                                },
                                {
                                    value: returnData.min_xz,
                                    name: '最小薪资',
                                    itemStyle: {normal: {areaStyle: {type: 'default'}}},
                                    areaStyle: {
                                        normal: {
                                            color: 'rgba(255, 255, 255, 0.5)'
                                        }
                                    },
                                    lineStyle: {
                                        normal: {
                                            type: 'dotted'
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                    };
                    var myChart = echarts.init(document.getElementById('main'));
                    myChart.setOption(myoption);
                }
                else
                {
                    alert('暂无数据')
                }
            }
        })

    })
</script>
</body>
</html>